<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get collator's last error code</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="collator.getattribute.html">« Collator::getAttribute</a></li>
      <li style="float: right;"><a href="collator.geterrormessage.html">Collator::getErrorMessage »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.collator.html">Collator</a></li>
    <li>Get collator's last error code</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="collator.geterrorcode" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Collator::getErrorCode</h1>
  <h1 class="refname">collator_get_error_code</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Collator::getErrorCode</span> -- <span class="refname">collator_get_error_code</span> &mdash; <span class="dc-title">Get collator&#039;s last error code</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-collator.geterrorcode-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Collator::getErrorCode</strong></span>(): <span class="type"><span class="type">int</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>collator_get_error_code</strong></span>(<span class="methodparam"><span class="type"><a href="class.collator.html" class="type Collator">Collator</a></span> <code class="parameter">$object</code></span>): <span class="type"><span class="type">int</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-collator.geterrorcode-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">object</code></dt>

     <dd>

      <p class="para">
       <span class="classname"><a href="class.collator.html" class="classname">Collator</a></span> object.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>



 <div class="refsect1 returnvalues" id="refsect1-collator.geterrorcode-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Error code returned by the last Collator <abbr title="Application Programming Interface">API</abbr> function call,
    或者在失败时返回 <strong><code>false</code></strong>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-collator.geterrorcode-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2287">
    <p><strong>示例 #1 <span class="function"><strong>collator_get_error_code()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$coll&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">collator_create</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'en_US'&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #0000BB">collator_get_attribute</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$coll</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">Collator</span><span style="color: #007700">::</span><span style="color: #0000BB">FRENCH_COLLATION&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #0000BB">false&nbsp;</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">handle_error</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">collator_get_error_code</span><span style="color: #007700">()&nbsp;);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-collator.geterrorcode-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="collator.geterrormessage.html" class="function" rel="rdfs-seeAlso">collator_get_error_message()</a> - Get text for collator's last error code</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>